@use 'sass:list';
@use 'sass:map';
@use 'sass:meta';
@use "sass:math";

// @use "sass:random";
// 自定义样式
.m05 {
	margin: 0 5px;
}

.flex-start {
	display: flex;
	justify-content: flex-start;
}

.flex-end {
	display: flex;
	justify-content: flex-end;
}

.flex-center {
	display: flex;
	justify-content: center;
	align-items: center;
}

.flex-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.Pixel {
	font-family: 'Pixel';
}
.Chillax {
	font-family: 'Chillax';
}
.Chillax-Bold {
	font-family: 'Chillax-Bold';
}
.Chillax-Medium {
	font-family: 'Chillax-Medium';
}

.mainBtn {
	background-color: var(--main);
	border-color: var(--main);
}

/** 省略号 */
@mixin ellipsis() {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@mixin ellipsis2($t: 2) {
	display: -webkit-box;
	overflow: hidden;
	text-overflow: ellipsis;
	-webkit-line-clamp: $t;
	-webkit-box-orient: vertical;
}

@mixin flexc() {
	display: flex;
	align-items: center;
	justify-content: center;
}

@mixin flexb() {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

@mixin flexs() {
	display: flex;
	align-items: center;
	justify-content: flex-start;
}

@mixin flexe() {
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

@mixin flextop() {
	display: flex;
	align-items: flex-start;
}

@mixin flexbottom() {
	display: flex;
	align-items: flex-end;
}

@mixin grid($t, $gap: 20px) {
	display: grid;
	grid-template-columns: repeat($t, 1fr);
	grid-gap: $gap;
}

@mixin Pixel {
	font-family: 'Pixel';
}


$devices: (
	mobile: (0px,
		821px),
	pc: (821px,
		1440px),
	desktop: (1440px,
		1920px)
);

@mixin responseTo($device: 'pc') {
	$bp: map.get($devices, $device);

	@if meta.type-of($bp)=='list' {
		@media screen and (min-width: list.nth($bp, 1)) and (max-width: list.nth($bp, 2)) {
			@content;
		}
	}

	@else {
		@media screen and (min-width: $bp) {
			@content;
		}
	}
}



// shadowFun 函数
@function shadowFun($n) {
	$shadows: math.random(100) * 1vw #{math.random(100) * 1vh} #fff;

	$colors: #fff, var(--main), #fff, var(--warn), #fff, var(--danger);

	// 随机颜色生成
	@for $i from 2 through $n {
		$shadows: #{$shadows}, #{math.random(100) * 1vw} #{math.random(100) * 1vh} #{list.nth($colors, math.random(6))};
	}

	@return $shadows;
}

$time: 100s;
$count: 800;

// 定义星星
@for $i from 1 through 3 {
	$time: math.floor(math.div($time, 2));
	$count: math.floor(math.div($count, 2));

	.star#{$i} {
		$size: #{$i}px;
		position: fixed;
		width: $size;
		height: $size;
		border-radius: 50%;
		top: 0;
		left: 0;
		box-shadow: shadowFun($count);
		animation: moveUp $time linear infinite;
		z-index: 9999;

		&::after {
			content: '';
			position: fixed;
			left: 0;
			top: 100vh;
			width: $size;
			height: $size;
			border-radius: inherit;
			box-shadow: inherit;
		}
	}
}